<?php namespace Common\Model;
use Hdphp\Model\Model;
class Type extends Model{
	protected $table = 'type';
	protected $validate = array(
		array('tname','required','类型名称不能为空',3,3)
	);
	
	//类型添加
	public function store(){
		if($this->create()){
//			p($this->data);exit;
			$this->add();
			return true;
		}
		return false;
	}
	
	//修改
	public function edit(){
		if(!$this->create()) return false;
		$this->save();
		return true;
	}
}
